[PATCH] QFileSystemEngine: handle copy_file_range() returning ENOSYS error
authorThiago Macieira <thiago.macieira@intel.com>
Fri, 13 Feb 2026 02:02:02 +0000 (18:02 -0800)
committerPino Toscano <pino@debian.org>
Sat, 2 May 2026 08:14:59 +0000 (10:14 +0200)
commit17a0b57750ff76e70edd05b746e07acd8733bec1
tree1449e2eff35a0232e0a9dab2b75e956ac33c066e
parent917ee8c8731c2f893ca35eab94f62267dc2cff84
[PATCH] QFileSystemEngine: handle copy_file_range() returning ENOSYS error

This shouldn't have happened, because minimum-linux_p.h would have
declared our need for a Linux kernel 4.5 or higher. I think the issue is
not the kernel, but a container wrapping the Qt application and
filtering system calls for security. If this container hasn't been
updated to know about the system call, it may cause an ENOSYS error.

Because we now handle the condition, this commit removes the 4.5 minimum
Linux version requirement from minimum-linux_p.h.

[ChangeLog][QtCore][QFile] Added a workaround to a compatibility issue
of the copy() implementation in some containerized Linux environments,
which could cause the file copy to fail with a "Function not
implemented" error. This is believed to be a bug in the container
runtime, not Qt, in that the container wrongly filtered the
copy_file_range(2) system call that the Linux kernel supports.

Fixes: QTBUG-144142
Change-Id: Iedbf805486ad79e7127dfffd22043889359563fd
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit b1b45ca4441db9e880e3a7fc7f4e8aa3af870eb6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 7b8591ac572079e59f856fb0ac7f4e3312f6dd43)

Gbp-Pq: Name upstream_QFileSystemEngine-handle-copy_file_range-returning-E.patch
src/corelib/global/minimum-linux_p.h
src/corelib/io/qfilesystemengine_unix.cpp